
<template>
    <div>
      <el-row :gutter="30">
        <el-col :span="3"
          ><div class="grid-content bg-purple">&emsp;</div></el-col
        >
        <el-col :span="18">
          <el-form :model="userinfo" label-width="80px">
            <el-tabs type="border-card" >
              <el-tab-pane >
                <span slot="label"><i class="el-icon-date"></i>基础信息</span>
                <el-form-item label="真实姓名">
                  <el-input v-model="userinfo.userinfoRealname"  :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="手机号码">
                  <el-input v-model="userinfo.userinfoTel"   :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="身份证号">
                  <el-input  :disabled="true" v-model="userinfo.userinfoCardNo"></el-input>
                </el-form-item>
                <el-form-item label="婚姻状况">
                  <el-input   :disabled="true" v-model="userinfo.userinfoMaritaStatus"></el-input>
                </el-form-item>
                <el-form-item label="现住地址">
                  <el-input  :disabled="true" v-model="userinfo.userinfoDetailedAddress"></el-input>
                </el-form-item>
                <el-form-item label="详细住址">
                  <el-input  :disabled="true"
                    v-model="userinfo.userinfoCurrentResidence"
                  ></el-input>
                </el-form-item>
                <el-form-item label="最高学历">
                  <el-input   :disabled="true" v-model="userinfo.userinfoDegree"></el-input>
                </el-form-item>
                <el-form-item label="月收入">
                  <el-input :disabled="true"  v-model="userinfo.userinfoIncome"></el-input>
                </el-form-item>
              </el-tab-pane>
              <el-tab-pane label="户籍及联系人信息">
                <el-form-item label="籍贯信息">
                  <el-input  :disabled="true" v-model="userinfo.userinfoNativePlace"></el-input>
                </el-form-item>
                <el-form-item label="亲属姓名">
                  <el-input :disabled="true" 
                    v-model="userinfo.userinfoImmediateRelative"
                  ></el-input>
                </el-form-item>
                <el-form-item label="亲属关系">
                  <el-input :disabled="true"  v-model="userinfo.userinfoRelationship"></el-input>
                </el-form-item>
                <el-form-item label="亲属联系方式">
                  <el-input :disabled="true" 
                    v-model="userinfo.userinfoRelationshipPhone"
                  ></el-input>
                </el-form-item>
              </el-tab-pane>
              <el-tab-pane label="工作信息">
                <el-form-item label="公司姓名">
                  <el-input :disabled="true"  v-model="userinfo.companyName"></el-input>
                </el-form-item>
                <el-form-item label="公司地址">
                  <el-input :disabled="true"  v-model="userinfo.companyAddress"></el-input>
                </el-form-item>
                <el-form-item label="详细地址">
                  <el-input :disabled="true"  v-model="userinfo.companyDetailedAddress"></el-input>
                </el-form-item>
                <el-form-item label="公司性质">
                  <el-input  :disabled="true" v-model="userinfo.companyNature"></el-input>
                </el-form-item>
  
                <el-form-item label="公司行业">
                  <el-input :disabled="true"  v-model="userinfo.companyIndustry"></el-input>
                </el-form-item>
  
                <el-form-item label="联系方式">
                  <el-input :disabled="true"  v-model="userinfo.companyTel"></el-input>
                </el-form-item>
  
                <el-form-item label="入职时长">
                  <el-input :disabled="true"  v-model="userinfo.userinfoEntryTime"></el-input>
                </el-form-item>
              </el-tab-pane>
              <el-tab-pane label="身份证照片">
                <el-form-item label="身份证正面照">
                      <el-image
                        :src="userinfo.userinfoFrontPhoto"
                        style="width: 600px; height: 280px"
                      >
                      </el-image>
                </el-form-item>
  
                <el-form-item label="身份证反面照">
                      <el-image
                        :src="userinfo.userinfoReversePhoto"
                        style="width: 600px; height: 280px"
                      >
                      </el-image>
                </el-form-item>
  
                <el-form-item label="手持身份证正面照">
                      <el-image
                        :src="userinfo.holdFrontPhoto"
                        style="width: 600px; height: 280px"
                      >
                      </el-image>
                </el-form-item>
  
                
              </el-tab-pane>

              <el-tab-pane label="审批意见">
                    <el-form-item label="审批意见">
                        <el-input v-model="userinfo.backup2"></el-input>
                    </el-form-item>
              </el-tab-pane>
            </el-tabs>
  
            <el-form-item>
              <el-button type="primary" @click="onSubmit">审核通过</el-button>
              <el-button type="danger" @click="onbohui" >审核驳回</el-button>
            </el-form-item>
          </el-form>

        </el-col>
  
        <el-col :span="3"><div class="grid-content bg-purple"></div></el-col>
      </el-row>

    </div>
  </template>
  
  <script>
  export default {
    data() {
      return {
        user: {
        },
        debitlist:{
          debitId:0,
          debitStatus:0,
        },
        userinfo: {
            userId:3,
            getBackup1:0,
            userinfoId:0,
        },
        dialogFlag: false,
        titleWord: "",
        src: "",
        imageUrl:"",
        agg:0,
        loanTime:0,
        productLoanAmount:0,
      };
    },
    methods: {
        
      //审核通过按钮
      onSubmit() {
        this.debitlist.debitStatus = 11;
        this.updateDebit();
      },

      //审核不通过按钮
      onbohui() {
        this.debitlist.debitStatus = 12;
        this.updateDebit();
      },

      updateDebit(){
        this.$axios.post("/debit/updateDebit",this.debitlist).then(res=>{
            if(res.data.code == 200) {
                this.$message.success("提交成功");
                this.$router.push("/AdminDebit");
            }else{
                this.$message.error("提交失败");
                this.$router.push("/AdminDebit");
            }
        });
      },

      // findUserInfoByuserid() {
      //   this.userinfo.userId = localStorage.getItem("userId");
      //   this.$axios.post("/userinfo/getuserinfoidbyuserid",this.userinfo).then(res=>{
      //     console.log("正在执行");
      //     if(res.data.code == 200) {
      //       this.userinfo = res.data.data.userinfo;
      //     }
      //   });
      // },

      
      loadUserInfoMation() {
        this.$axios.post("/userinfo/getuserinfoid",this.userinfo).then(res=>{
          if(res.data.code == 200) {
            this.userinfo = res.data.data.userinfo;
          }
        });
      },

    },
    
    // beforeMount(){
    //   this.user = JSON.parse(sessionStorage.getItem("user"));
    //   this.findUserinfoid();
    // },
    
    //审核员查看人员信息
    mounted() {
      this.userinfo.userinfoId = localStorage.getItem("userinfoId");
      this.debitlist.debitId = localStorage.getItem("debitId");
      this.loadUserInfoMation();
    },
    // beforeMount(){
    //   this.findUserInfoByuserid();
    // }
    
  };
  </script>
  
  <style>
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409eff;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }
  .avatar {
    width: 178px;
    height: 178px;
    display: block;
  }
  </style>
 